<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>语音问询</title>
    <script type="text/javascript" src="<c:url value='/static/js/admin/voiceAsk/list.js' />"></script>
</head>

<body>
<c:if test="${!empty param.msg}">
	<div class="alert alert-green fadein-top"><span class="close rotate-hover"></span><strong>提示：</strong>${param.msg}</div>
</c:if>
<form id="form" method="post" action="<c:url value='/admin/voiceAsk/list' />" name="form">
<div class="panel admin-panel">
	<div class="panel-head"><strong>语音列表</strong></div>
    <div class="padding border-bottom">
      	<div class="line">
	       	<div class="x4"></div>
	    	<div class="x5"></div>
	    	<div class="x3">
	   			<div class="input-group padding-little-top"> 
	   				<input type="text" class="input input-small border-main" name="wxNikeName" value="${voiceAsk.wxNikeName}" placeholder="请输入：微信昵称查询" /> 
	   				<span class="addbtn"><button type="submit" class="button input-small bg-main">筛选</button></span> 
	   			</div>
	    	</div>
    	</div>
    </div>
    <table class="table table-hover">
       	<tr>
        	<th width="100">微信昵称</th>
        	<th width="100">
        		<select name="type" onchange="form.submit()">
					<option value="-1" <c:if test="${type == -1 }">selected="selected"</c:if>>问询类型</option>
					<option value="0" <c:if test="${type == 0 }">selected="selected"</c:if>>语音</option>
					<option value="1" <c:if test="${type == 1 }">selected="selected"</c:if>>文字</option>
				</select>
        	</th>
        	<th width="100">内容</th>
        	<th width="100">
        		<select name="readStatus" onchange="form.submit()">
					<option value="-1" <c:if test="${readStatus == -1 }">selected="selected"</c:if>>阅读状态</option>
					<option value="0" <c:if test="${readStatus == 0 }">selected="selected"</c:if>>未读</option>
					<option value="1" <c:if test="${readStatus == 1 }">selected="selected"</c:if>>已读</option>
				</select>
        	</th>
        	<th width="100">
        		<select name="replyState" onchange="form.submit()">
					<option value="-1" <c:if test="${replyState == -1 }">selected="selected"</c:if>>回复状态</option>
					<option value="0" <c:if test="${replyState == 0 }">selected="selected"</c:if>>未回复</option>
					<option value="1" <c:if test="${replyState == 1 }">selected="selected"</c:if>>已回复</option>
					<option value="1" <c:if test="${replyState == 2 }">selected="selected"</c:if>>自动回复</option>
				</select>
        	</th>
        	<th width="100">创建时间</th>
        	<th width="140">操作</th>
       	</tr>
       	<c:forEach items="${pager.datas}" var="pd">
       		<tr>
       			<td>${pd.wxNikeName}</td>
       			<td>
       				<c:if test="${pd.type == 0 }">语音</c:if>
					<c:if test="${pd.type == 1 }">文字</c:if>
       			</td>
       			<td>${pd.recognition}</td>
       			<td>
	       			<c:if test="${pd.isRead == 0 }">未读</c:if>
					<c:if test="${pd.isRead == 1 }">已读</c:if>
       			</td>
       			<td id="reply-state-${pd.id}">
	       			<c:if test="${pd.replyState == 0 }">未回复</c:if>
					<c:if test="${pd.replyState == 1 }">已回复</c:if>
					<c:if test="${pd.replyState == 2 }">自动回复</c:if>
       			</td>
       			<td>
       				<fmt:formatDate value="${pd.publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
       			</td>
       			<td>
        			<a class="button border-blue button-little" href="javascript:void(0);" onclick="reply('${pd.id}')">回复</a>
        			<c:if test="${pd.type == 0 }">
        			<a class="button border-blue button-little" href="javascript:void(0);" onclick="paly('${pd.voiceUrl}', '${pd.id}')">播放</a>
       				</c:if>
       			</td>
       		</tr>
       	</c:forEach>
    </table>
	  <jsp:include page="../../commons/pager.jsp">
	    	<jsp:param value="list" name="url"/>
	  </jsp:include>
</div>
</form>

<div id="reply-body" style="display: none;">
	<div class="dialog-mask" style="z-index:10000"></div>
	<div class="dialog-win" style="position:fixed;width:800px;z-index:10001;left:250px;top:20px;">
		<div class="dialog open">
			<form>
			<input id="voiceId" type="hidden" value="" />
			<div class="dialog-head">
				<span id="reply-close" class="close rotate-hover"></span>
				<strong>系统弹出框</strong>
			</div>
			<div class="dialog-body">
				<div id="reply-content" style="max-height: 300px;min-height:200px; overflow: auto;"></div>
				<div>
					<div class="form-group">
						<div class="label">
							<label for="marketPrice"></label>
						</div>
						<div class="field">
							<textarea class="input" id="replyContent" name="replyContent" 
							placeholder="请填写回复内容"  data-validate="required:必填,,length#<=250:不超过250个字"></textarea>
						</div>
					</div>
				</div>
			</div>
			<div class="dialog-foot">
				<button id="reply-publish" type="button" class="button bg-green">发表</button>
				<button id="reply-cancel" type="button" class="button dialog-close">取消</button>
			</div>
			</form>
		</div>
	</div>
</div>
</body>
</html>